package com.mf.all.entity.req.user;

import java.io.Serial;

import com.mf.all.groups.GroupsAddInterface;
import com.mf.all.groups.GroupsUpdateInterface;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户表提交
 *
 * @date 2025-04-02 22:36:48
 */
@Data
public class ReqUser implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @NotNull(message = "id不能为空", groups = {GroupsUpdateInterface.class})
    private Long id;

    @Schema(description = "用户名")
    @NotBlank(message = "用户名不能为空", groups = {GroupsUpdateInterface.class, GroupsAddInterface.class})
    @Size(min = 4, message = "用户名长度不能小于4")
    private String username;

    @Schema(description = "密码")
    @NotBlank(message = "密码不能为空", groups = {GroupsAddInterface.class})
    @NotBlank(message = "密码不能为空", groups = {GroupsAddInterface.class})
    @Size(min = 6, max = 20, message = "密码长度在6-20位之间", groups = {GroupsAddInterface.class})
    @Null(message = "不可直接修改密码", groups = {GroupsUpdateInterface.class})
    @Size(min = 6, max = 20, message = "密码长度在6-20位之间")
    private String password;
    @Schema(description = "昵称")
    @NotBlank(message = "昵称不能为空", groups = {GroupsUpdateInterface.class, GroupsAddInterface.class})
    private String nick;
    @Schema(description = "邮箱")
    @Email(message = "邮箱格式不正确", groups = {GroupsUpdateInterface.class, GroupsAddInterface.class})
    private String email;

    @Schema(description = "所属岗位")
    private Integer jobId;
    @Schema(description = "所属部门")
    private Integer deptId;
    private String remark;
}
